<template>
    <div>
        <div class="head">
            <div class="headtitle">{{ getdata.name }}/{{ userId }}</div>
        </div>
        <div class="headinfo">
            <div class="oneh">
                <div class="createtime">
                    <h1>客户姓名</h1>
                    <p>{{ getdata.name }}</p>
                </div>
                <div class="createtime">
                    <h3>性别</h3>
                    <p>{{ getdata.gender }}</p>
                </div>
                <div class="createtime">
                    <h3>年龄</h3>
                    <p>{{ getdata.age }}</p>
                </div>
            </div>
            <div class="oneh twoh">
                <div class="createtime">
                    <h1>线索分配者</h1>
                    <p>admin</p>
                </div>
                <div class="createtime">
                    <h3>线索归属时间</h3>
                    <p>{{ getdata.updateTime }}</p>
                </div>
                <div class="createtime">
                    <h3>线索归属人</h3>
                    <p>admin</p>
                </div>
            </div>
            <div class="oneh twoh">
                <el-button type="danger" disabled>无效线索</el-button>
                <el-button type="primary" disabled>转为商机</el-button>
            </div>
        </div>
        <div class="xsgj">
            <div>线索跟进</div>

            <div class="headinfo">
                <div class="oneh">
                    <div class="createtime">
                        <h1>线索创建时间</h1>
                        <p>{{ getdata.createTime }}</p>
                    </div>
                    <div class="createtime">
                        <h3>客户手机号码</h3>
                        <p>{{ getdata.phone }}</p>
                    </div>
                    <div class="createtime">
                        <h3>渠道来源</h3>
                        <p>{{ getdata.channelId }}</p>
                    </div>
                </div>
                <div class="oneh twoh">
                    <div class="createtime">
                        <h1>客户微信号码</h1>
                        <p>{{ getdata.weixin }}</p>
                    </div>
                    <div class="createtime">
                        <h3>客户QQ号码</h3>
                        <p>{{ getdata.qq }}</p>
                    </div>
                    <div class="createtime">
                        <h3>客户手机号码</h3>
                        <p>{{ getdata.phone }}</p>
                    </div>
                </div>
            </div>
        </div>
        <el-button @click="returnclue">返回</el-button>
    </div>
</template>

<script setup>
onMounted(() => {
    getData();
});
import { useRoute } from 'vue-router';

const route = useRoute();
const userId = route.params.id; // 获取路径参数

import { getxsdata } from '@/api/clue/getIndex';
import { onMounted, reactive } from 'vue';
const getdata = reactive({});
const getData = () => {
    getxsdata(userId).then(res => {
        console.log(res);
        Object.assign(getdata, res.data);
        console.log(getdata);
    });
};
const returnclue = () => {
    window.history.go(-1);
};
</script>

<style lang="scss" scoped>
.head {
    padding-left: 10px;
}

.headtitle {
    margin-top: 10px;
}

.oneh {
    margin-top: 20px;
    display: flex;
}

.headinfo {
    padding-left: 20px;
}

.createtime {
    margin-right: 40px;
}

.twoh {
    margin-top: 30px;
}

.xsgj {
    margin-top: 30px;
    padding-left: 10px;
}
</style>